<?php 
namespace XFCore\traits\api;
use lib\{PayUtils};
trait JuheTrait{
    public function paypage($get){
        if($this->conf->juheshoukuan == 0){
            $this->echomsg("Tips",'管理员未开启聚合收款');
        }
        $token = urldecode($get['token']);
        if(empty($token)){
            $this->echomsg("Tips",'token不能为空');
        }
        $pid = aes256auth($token , SYS_KEY , 'DECODE');

        if(empty($pid)){
            $this->echomsg("Tips",'token错误');
        }
        $userrow = $this->db->userrow($pid , 'pid' , '`codename`,`username`');
        $codename = $userrow['codename']?:$userrow['username'];
        include usertem . 'paypage.php'; 
        
    }
    public function succpay($get){
        
        $token = $get['token'];
        unset($get['token']);

        $userrow = $this->db->userrow($get['pid'] , 'pid' , "`pid`,`key` ,`api_mode`,`rsaprivatekey`");
        if(empty($userrow)){
            $this->echomsg("Tips",'商户不存在');
        }
        if($userrow['api_mode'] == 2){
            $get =  $this->decodersatoken($userrow,$token);
        }
        $this->Examine_Sign($get,$userrow);
        include usertem . 'succjupay.php'; 
    }
}

?>